package com.zzyweb.managementsystem.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @author zhiyi
 * @date 9/23/25
 **/
@TableName("t_menu")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Menu {
    @TableId(type = IdType.AUTO)
    private Integer mid;

    private Integer pid;

    private String mname;

    private String icon;

    private String route;
    @TableField("sortid")
    private Integer sortId;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@TableField(fill = FieldFill.INSERT)
    private Date createtime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //@TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updatetime;

    @TableField(exist = false)
    private List<Menu> children;
}
